home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / battlefi.swf / scripts / frame_636 / PlaceObject2_17_2214 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2010-11-09  |  605b  |  30 lines

  1. onClipEvent(enterFrame){
  2.    a = total / 5 * 4;
  3.    b = total / 5 * 3;
  4.    c = total / 5 * 2;
  5.    d = total / 5;
  6.    if(this._xscale <= 0)
  7.    {
  8.       this._xscale = 0;
  9.    }
  10.    percent = remaining / total * 100;
  11.    this._xscale = percent;
  12.    _root.rem = remaining;
  13.    if(remaining < a && remaining > b)
  14.    {
  15.       _root.castle.gotoAndStop(2);
  16.    }
  17.    if(remaining < b && remaining > c)
  18.    {
  19.       _root.castle.gotoAndStop(3);
  20.    }
  21.    if(remaining < c && remaining > d)
  22.    {
  23.       _root.castle.gotoAndStop(4);
  24.    }
  25.    if(remaining < d)
  26.    {
  27.       _root.castle.gotoAndStop(5);
  28.    }
  29. }
  30.